import request from '@/utils/request'

// 查询远程开放时长列表
export function listTimer(query) {
  return request({
    url: '/system/timerVisit/list',
    method: 'get',
    params: query
  })
}

// 查询远程开放时长详细
export function getTimer(id) {
  return request({
    url: '/system/timerVisit/' + id,
    method: 'get'
  })
}

// 新增远程开放时长
export function addTimer(data) {
  return request({
    url: '/system/timerVisit',
    method: 'post',
    data: data
  })
}

// 修改远程开放时长
export function updateTimer(data) {
  return request({
    url: '/system/timerVisit',
    method: 'put',
    data: data
  })
}

// 删除远程开放时长
export function delTimer(id) {
  return request({
    url: '/system/timerVisit/' + id,
    method: 'delete'
  })
}

// 导出远程开放时长
export function exportTimer(query) {
  return request({
    url: '/system/timerVisit/export',
    method: 'get',
    params: query
  })
}

// 状态修改
export function changeStatus(id, status) {
  const data = {
    id,
    status
  }
  return request({
    url: '/system/timerVisit/changeStatus',
    method: 'put',
    data: data
  })
}